import Cookies from 'js-cookie'

const sidebarStatusKey = 'sidebar_status'
export const getSidebarStatus = () => Cookies.get(sidebarStatusKey)
export const setSidebarStatus = (sidebarStatus: string) => Cookies.set(sidebarStatusKey, sidebarStatus)

const TokenKey = ''
const RefreshTokenKey = ''
const UserNameKey = 'userName'
export const getToken = () => Cookies.get(TokenKey)
export const getRefreshToken = ()=>{
  return Cookies.get(RefreshTokenKey)
}
export const setToken = (token: any) =>{
  Cookies.set(TokenKey, token.accessToken)
  Cookies.set(RefreshTokenKey, token.refreshToken)
} 

export const removeToken = () => {
  Cookies.remove(TokenKey)
  Cookies.remove(RefreshTokenKey)
}

export function setUserName(username:any) {
  return Cookies.set(UserNameKey, username)
}
export function getUserName() {
  return Cookies.get(UserNameKey)
}